package org.FaPe3D.core.parsers.casting
{
	import flash.events.*;
	
	import org.papervision3d.events.FileLoadEvent;
	import org.papervision3d.events.InteractiveScene3DEvent;
	
	public class Events
	{
		public function cast(type:String):*
		{
			var result:* = null;
			var _arr:Array = type.split('.');
			var _type:String = _arr[0];
			var _state:String = _arr[1];

			switch (_type)
			{
				case 'MouseEvent':
					result = MouseEvent[_state];	
				break;
				
				case 'Event':
					result = Event[_state];	
				break;
				
				case 'KeyboardEvent':
					result = KeyboardEvent[_state];	
				break;
				
				case 'FullScreenEvent':
					result = FullScreenEvent[_state];	
				break;
				
				case 'InteractiveScene3DEvent':
					result = InteractiveScene3DEvent[_state];
				break;
				
				case 'FileLoadEvent':
					result = FileLoadEvent[_state];
				break;
			}
			return result;
		}
	}
}